By the way, I'm pretty much a newbie at LotusScript, so be gentle...
I have a web application that calls an agent on WebQuerySave. That agent calls another agent that is giving me problems. I am trying to send an email notification with the web link. Looking at my code, you can see that I have a few MSGBOX lines. I can get the "inside Sendmail" and docurl MSGBOX to display, but not the one in my IF statement. When the code is run I get an "Error 13: Type mismatch" displayed to the browser. Any clues? Thanks for any help.
Sub Sendmail
Msgbox "inside SendMail"
Dim s As NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument
Dim DocURL As String
Set s = New NotesSession
Set db = s.currentdatabase
Set view = db.getview("ContractsByNumber")
Set doc = view.GetLastDocument
DocURL = "
http://hqapp01.comporium.com/workflow/cn2workflow.nsf/$All/"+ doc.universalid
Msgbox docurl
If doc.Status = "New" Then
Msgbox "status is new"
'The following section emails a link to the database to the intended recipient
Dim session As New NotesSession
Dim maildb As NotesDatabase
Dim maildoc As NotesDocument
Dim rtitem As NotesRichTextItem
Set session = New NotesSession
Set maildb = session.CurrentDatabase
Set maildoc = New NotesDocument( maildb )
Set rtitem = New NotesRichTextItem( maildoc, "Body" )
Call rtitem.AppendText ("The new contract may be viewed by clicking below.")
Call rtitem.AddNewLine( 2 )
Call rtitem.AppendText("Here is a link to the CN2 Contracts database: ")
Call rtitem.AppendDocLink( maildb, maildb.Title )
Call rtitem.AppendText("Open in web browser:")
maildoc.Form = "Memo"
maildoc.ReplyTo=doc.user
maildoc.SendTo = "Chris Whisonant/COMPORIUM"
maildoc.Subject = "New CN2 Contract"
Call maildoc.Send( False )
doc.Status="Submitted"
Call doc.Save (True, True)
Else
Msgbox "Error"
End If
Msgbox "completed sendmail"
End Sub